/**
 * <copyright>
 * </copyright>
 *

 */
package ms.unicorn.language.languagedef.impl;

import ms.unicorn.language.languagedef.LanguageDef;
import ms.unicorn.language.languagedef.LanguagedefPackage;
import ms.unicorn.language.languagedef.ToolBox;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Language Def</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ms.unicorn.language.languagedef.impl.LanguageDefImpl#getText <em>Text</em>}</li>
 *   <li>{@link ms.unicorn.language.languagedef.impl.LanguageDefImpl#getModelExtension <em>Model Extension</em>}</li>
 *   <li>{@link ms.unicorn.language.languagedef.impl.LanguageDefImpl#getDiagramExtension <em>Diagram Extension</em>}</li>
 *   <li>{@link ms.unicorn.language.languagedef.impl.LanguageDefImpl#getSmallimage <em>Smallimage</em>}</li>
 *   <li>{@link ms.unicorn.language.languagedef.impl.LanguageDefImpl#getLargeimage <em>Largeimage</em>}</li>
 *   <li>{@link ms.unicorn.language.languagedef.impl.LanguageDefImpl#getToolbox <em>Toolbox</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class LanguageDefImpl extends ModuleImpl implements LanguageDef
{
  /**
   * The default value of the '{@link #getText() <em>Text</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getText()
   * @generated
   * @ordered
   */
  protected static final String TEXT_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getText() <em>Text</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getText()
   * @generated
   * @ordered
   */
  protected String text = TEXT_EDEFAULT;

  /**
   * The default value of the '{@link #getModelExtension() <em>Model Extension</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getModelExtension()
   * @generated
   * @ordered
   */
  protected static final String MODEL_EXTENSION_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getModelExtension() <em>Model Extension</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getModelExtension()
   * @generated
   * @ordered
   */
  protected String modelExtension = MODEL_EXTENSION_EDEFAULT;

  /**
   * The default value of the '{@link #getDiagramExtension() <em>Diagram Extension</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDiagramExtension()
   * @generated
   * @ordered
   */
  protected static final String DIAGRAM_EXTENSION_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getDiagramExtension() <em>Diagram Extension</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDiagramExtension()
   * @generated
   * @ordered
   */
  protected String diagramExtension = DIAGRAM_EXTENSION_EDEFAULT;

  /**
   * The default value of the '{@link #getSmallimage() <em>Smallimage</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSmallimage()
   * @generated
   * @ordered
   */
  protected static final String SMALLIMAGE_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getSmallimage() <em>Smallimage</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSmallimage()
   * @generated
   * @ordered
   */
  protected String smallimage = SMALLIMAGE_EDEFAULT;

  /**
   * The default value of the '{@link #getLargeimage() <em>Largeimage</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLargeimage()
   * @generated
   * @ordered
   */
  protected static final String LARGEIMAGE_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getLargeimage() <em>Largeimage</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLargeimage()
   * @generated
   * @ordered
   */
  protected String largeimage = LARGEIMAGE_EDEFAULT;

  /**
   * The cached value of the '{@link #getToolbox() <em>Toolbox</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getToolbox()
   * @generated
   * @ordered
   */
  protected ToolBox toolbox;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected LanguageDefImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return LanguagedefPackage.Literals.LANGUAGE_DEF;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getText()
  {
    return text;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setText(String newText)
  {
    String oldText = text;
    text = newText;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, LanguagedefPackage.LANGUAGE_DEF__TEXT, oldText, text));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getModelExtension()
  {
    return modelExtension;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setModelExtension(String newModelExtension)
  {
    String oldModelExtension = modelExtension;
    modelExtension = newModelExtension;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, LanguagedefPackage.LANGUAGE_DEF__MODEL_EXTENSION, oldModelExtension, modelExtension));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getDiagramExtension()
  {
    return diagramExtension;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setDiagramExtension(String newDiagramExtension)
  {
    String oldDiagramExtension = diagramExtension;
    diagramExtension = newDiagramExtension;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, LanguagedefPackage.LANGUAGE_DEF__DIAGRAM_EXTENSION, oldDiagramExtension, diagramExtension));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getSmallimage()
  {
    return smallimage;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSmallimage(String newSmallimage)
  {
    String oldSmallimage = smallimage;
    smallimage = newSmallimage;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, LanguagedefPackage.LANGUAGE_DEF__SMALLIMAGE, oldSmallimage, smallimage));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getLargeimage()
  {
    return largeimage;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setLargeimage(String newLargeimage)
  {
    String oldLargeimage = largeimage;
    largeimage = newLargeimage;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, LanguagedefPackage.LANGUAGE_DEF__LARGEIMAGE, oldLargeimage, largeimage));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ToolBox getToolbox()
  {
    return toolbox;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetToolbox(ToolBox newToolbox, NotificationChain msgs)
  {
    ToolBox oldToolbox = toolbox;
    toolbox = newToolbox;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LanguagedefPackage.LANGUAGE_DEF__TOOLBOX, oldToolbox, newToolbox);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setToolbox(ToolBox newToolbox)
  {
    if (newToolbox != toolbox)
    {
      NotificationChain msgs = null;
      if (toolbox != null)
        msgs = ((InternalEObject)toolbox).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LanguagedefPackage.LANGUAGE_DEF__TOOLBOX, null, msgs);
      if (newToolbox != null)
        msgs = ((InternalEObject)newToolbox).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LanguagedefPackage.LANGUAGE_DEF__TOOLBOX, null, msgs);
      msgs = basicSetToolbox(newToolbox, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, LanguagedefPackage.LANGUAGE_DEF__TOOLBOX, newToolbox, newToolbox));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case LanguagedefPackage.LANGUAGE_DEF__TOOLBOX:
        return basicSetToolbox(null, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case LanguagedefPackage.LANGUAGE_DEF__TEXT:
        return getText();
      case LanguagedefPackage.LANGUAGE_DEF__MODEL_EXTENSION:
        return getModelExtension();
      case LanguagedefPackage.LANGUAGE_DEF__DIAGRAM_EXTENSION:
        return getDiagramExtension();
      case LanguagedefPackage.LANGUAGE_DEF__SMALLIMAGE:
        return getSmallimage();
      case LanguagedefPackage.LANGUAGE_DEF__LARGEIMAGE:
        return getLargeimage();
      case LanguagedefPackage.LANGUAGE_DEF__TOOLBOX:
        return getToolbox();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case LanguagedefPackage.LANGUAGE_DEF__TEXT:
        setText((String)newValue);
        return;
      case LanguagedefPackage.LANGUAGE_DEF__MODEL_EXTENSION:
        setModelExtension((String)newValue);
        return;
      case LanguagedefPackage.LANGUAGE_DEF__DIAGRAM_EXTENSION:
        setDiagramExtension((String)newValue);
        return;
      case LanguagedefPackage.LANGUAGE_DEF__SMALLIMAGE:
        setSmallimage((String)newValue);
        return;
      case LanguagedefPackage.LANGUAGE_DEF__LARGEIMAGE:
        setLargeimage((String)newValue);
        return;
      case LanguagedefPackage.LANGUAGE_DEF__TOOLBOX:
        setToolbox((ToolBox)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case LanguagedefPackage.LANGUAGE_DEF__TEXT:
        setText(TEXT_EDEFAULT);
        return;
      case LanguagedefPackage.LANGUAGE_DEF__MODEL_EXTENSION:
        setModelExtension(MODEL_EXTENSION_EDEFAULT);
        return;
      case LanguagedefPackage.LANGUAGE_DEF__DIAGRAM_EXTENSION:
        setDiagramExtension(DIAGRAM_EXTENSION_EDEFAULT);
        return;
      case LanguagedefPackage.LANGUAGE_DEF__SMALLIMAGE:
        setSmallimage(SMALLIMAGE_EDEFAULT);
        return;
      case LanguagedefPackage.LANGUAGE_DEF__LARGEIMAGE:
        setLargeimage(LARGEIMAGE_EDEFAULT);
        return;
      case LanguagedefPackage.LANGUAGE_DEF__TOOLBOX:
        setToolbox((ToolBox)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case LanguagedefPackage.LANGUAGE_DEF__TEXT:
        return TEXT_EDEFAULT == null ? text != null : !TEXT_EDEFAULT.equals(text);
      case LanguagedefPackage.LANGUAGE_DEF__MODEL_EXTENSION:
        return MODEL_EXTENSION_EDEFAULT == null ? modelExtension != null : !MODEL_EXTENSION_EDEFAULT.equals(modelExtension);
      case LanguagedefPackage.LANGUAGE_DEF__DIAGRAM_EXTENSION:
        return DIAGRAM_EXTENSION_EDEFAULT == null ? diagramExtension != null : !DIAGRAM_EXTENSION_EDEFAULT.equals(diagramExtension);
      case LanguagedefPackage.LANGUAGE_DEF__SMALLIMAGE:
        return SMALLIMAGE_EDEFAULT == null ? smallimage != null : !SMALLIMAGE_EDEFAULT.equals(smallimage);
      case LanguagedefPackage.LANGUAGE_DEF__LARGEIMAGE:
        return LARGEIMAGE_EDEFAULT == null ? largeimage != null : !LARGEIMAGE_EDEFAULT.equals(largeimage);
      case LanguagedefPackage.LANGUAGE_DEF__TOOLBOX:
        return toolbox != null;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (text: ");
    result.append(text);
    result.append(", modelExtension: ");
    result.append(modelExtension);
    result.append(", diagramExtension: ");
    result.append(diagramExtension);
    result.append(", smallimage: ");
    result.append(smallimage);
    result.append(", largeimage: ");
    result.append(largeimage);
    result.append(')');
    return result.toString();
  }

} //LanguageDefImpl
